home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / Framewrk / FWPart / FWFctClp.h < prev    next >
Encoding:
Text File  |  1996-09-17  |  3.3 KB  |  95 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWFctClp.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9. //
  10. //    Use a FacetClipper to calculate the clip shape of embedded facets.
  11. //
  12. //    Create a FW_CFacetClipper (or a subclass) on the stack or as a pointer.
  13. //
  14. //    If you want to calculate the clip shape of all the embedded facets of a presentation
  15. //    call:
  16. //    
  17. //            FW_CFacetClipper::Clip(Environment*, FW_CPresentation*, ODShape*);
  18. //
  19. //    If you want to calculate the clip shape of the embedded facets of one frame call:
  20. //
  21. //            FW_CFacetClipper::Clip(Environment*, FW_CEmbeddingFrame*, ODShape*);
  22. //
  23. //    The limitShape parameter can be null. If it is not null it should be in content 
  24. //    coordinate and only embedded facets intersecting with it will be clipped.
  25. //    
  26. //    The default version of ClipEmbeddedFacets doesn't take into account the content 
  27. //    of your part. If your content overlaps your embedded facets you need to provide 
  28. //    your own ClipEmbeddedFacets method. If there is no interaction between your content 
  29. //    and the embedded facets this default version is fine.
  30. //    NOTE: Your version of ClipEmbeddedFacets SHOULD NOT CALL INHERITED::ClipEmbeddedFacets.
  31. //
  32. //    If you override ClipEmbeddedFacets, call ClipOneEmbeddedFacet from your own 
  33. //    ClipEmbeddedFacets method. The workingClip parameter is the clip region to apply to 
  34. //    this embedded facet. When returning from ClipOneEmbeddedFacet, the usedShape of the 
  35. //    embedded facet will have been removed from workingClip. WorkingClip is in window
  36. //    coordinates
  37.  
  38. #ifndef FWFCTCLP_H
  39. #define FWFCTCLP_H
  40.  
  41. #ifndef FWEXCLIB_H
  42. #include "FWExcLib.h"
  43. #endif
  44.  
  45. //========================================================================================
  46. //    Forward Declarations
  47. //========================================================================================
  48.  
  49. class FW_CPart;
  50. class ODShape;
  51. class ODFacet;
  52. class FW_CEmbeddingFrame;
  53. class FW_CPresentation;
  54. struct Environment;
  55.  
  56. //========================================================================================
  57. //    class FW_CFacetClipper
  58. //========================================================================================
  59.  
  60. class FW_CFacetClipper
  61. {
  62. public:
  63.     FW_DECLARE_AUTO(FW_CFacetClipper)
  64.  
  65. //---------------------------------------------------------------------------------------
  66. //    Initialization/Destruction
  67. //
  68. public:
  69.     FW_CFacetClipper();
  70.     virtual ~FW_CFacetClipper();
  71.  
  72. //---------------------------------------------------------------------------------------
  73. //    New API
  74. //
  75. public:
  76.     virtual void         Clip(Environment *ev, FW_CPresentation *presentation, ODShape* limitShape = NULL);
  77.     virtual void         Clip(Environment *ev, FW_CEmbeddingFrame *embeddingFrame, ODShape* limitShape = NULL);
  78.     
  79.     virtual void         ClipEmbeddedFacets(Environment *ev, 
  80.                                 FW_CEmbeddingFrame *embeddingFrame,
  81.                                 ODFacet *containingFacet, 
  82.                                 ODShape* limitShape);
  83.  
  84.     void                ClipOneEmbeddedFacet(Environment *ev, 
  85.                                 ODFacet *embeddedFacet,
  86.                                 ODShape* workingClip,
  87.                                 ODShape* limitShape = NULL);
  88.     
  89.     ODShape*            AcquireWorkingClip(Environment *ev, 
  90.                                 FW_CEmbeddingFrame* embeddingFrame, 
  91.                                 ODFacet* containingFacet);
  92. };
  93.  
  94. #endif
  95.